﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace encrypt
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入要加密的字符串:");
            var text = Console.ReadLine();
            Console.WriteLine("请选择加密算法:1.MD5 2.SHA 3.RSA");
            var choose = Console.ReadLine();

            DoEncrypt encrypt = new DoEncrypt();
            if(choose == "1")
            {
                encrypt = new MD5();
            } else if(choose == "2")
            {
                encrypt = new SHA();
            } else if(choose == "3")
            {
                encrypt = new RSA();
            } else
            {
                Console.WriteLine("选择加密算法有误!!!");
            }
            string result = encrypt.GetEnctyptedText(text);
            Console.WriteLine("加密后的字符串为:" + result);

            Console.ReadLine();
        }
    }
}
